package com.un.ebs.inventory.domain;

import com.un.ebs.inventory.enums.BusinessRelationTypeEnum;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.springframework.stereotype.Component;
import lombok.Data;
import com.un.ebs.core.metadata.DbField;

/**
 * (EntRelation)表实体类
 *
 * @author makejava
 * @since 2021-03-16 15:04:33
 */
@Data
@Component
@TableName("tb_ent_relation")
@SuppressWarnings("serial")
public class EntRelation extends Model<EntRelation> {

    @TableId(value = "id", type = IdType.UUID)
    private String id;


    @DbField(name = "ent_id", length = 40, precision = 0)
    private String entId;

    @DbField(name = "relation_type", length = -1, precision = 0)
    private BusinessRelationTypeEnum relationType;

    @DbField(name = "tenant_id", length = 40, precision = 0)
    private String tenantId;

    @DbField(name = "code", length = -1, precision = 0)
    private Integer code;

    @DbField(name = "is_temp_contract_send", length = -1, precision = 0)
    private Boolean isTempContractSend;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @DbField(name = "open_api_user_id", length = 40, precision = 0)
    private String openApiUserId;

    @TableField(fill = FieldFill.INSERT)
    @DbField(name = "create_at", length = 40, precision = 0)
    private String createAt;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}